//
// Switch
// --------------------------------------------------


.switch {
	.user-select(none);
	cursor: pointer;
}

.switch input[type=checkbox] {
	opacity: 0;
	width: 0;
	height: 0;

	&:checked + .lever {
		background-color: lighten(@primary-color, 20%);

		&:after {
			background-color: @primary-color;
			left: 19px;
		}
	}
}

.switch .lever {
	content: "";
	display: inline-block;
	position: relative;
	width: 30px;
	height: 11px;
	background-color: #999;
	border-radius: 15px;
	margin-right: 10px;
	transition: background 0.3s ease;
	vertical-align: middle;
	margin: 0 16px;

	&:after {
		content: "";
		position: absolute;
		display: inline-block;
		width: 17px;
		height: 17px;
		background-color: #F1F1F1;
		border-radius: 50%;
		box-shadow: 0 1px 2px 1px rgba(0, 0, 0, .4);
		left: -5px;
		top: -3px;
		transition: left 0.3s ease, background .3s ease, box-shadow 0.1s ease;
	}
}

.switch span {
	vertical-align: middle;
}

// Switch active style
input[type=checkbox]:checked:not(:disabled) ~ .lever:active:after {
	box-shadow: 0 1px 2px 1px rgba(0, 0, 0, .4), 0 0 0 12px fade(@primary-color, 10%);
}

input[type=checkbox]:not(:disabled) ~ .lever:active:after {
	box-shadow: 0 1px 2px 1px rgba(0, 0, 0, .4), 0 0 0 12px rgba(0, 0, 0, .08);
}

// Disabled Styles
.switch input[type=checkbox][disabled] + .lever {
	cursor: default;
}

.switch input[type=checkbox][disabled] + .lever:after,
.switch input[type=checkbox][disabled]:checked + .lever:after {
	background-color: #F1F1F1;
}